package asymptotic_time_complexity;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        System.out.println(123);

        Test test = new Test();
        test.test();
    }

    List<List<Integer>> result = new ArrayList<>();

    private void test() {
        int[] array = new int[]{1, 2, 3};
        f(array, 0, new ArrayList<Integer>());
    }

    private void f(int[] array, int index, List<Integer> p) {
        // 终止条件
        if (p.size() == array.length) {
            // 收集结果
            result.add(p);
            return;
        }
        int endIndex = array.length - 1;
        for (int i = index; i <= endIndex; i++) {
            int num = array[i];
            p.add(num);
            f(array, i + 1, p);
        }
    }
}
